package com.isoft.mapper;

import com.isoft.pojo.vo.overviewVO;
import com.isoft.pojo.vo.statisticsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface DashboardMapper {
    @Select("select * from dashboard where date = #{now}")
    overviewVO getOverviewIntable(LocalDate now);

    @Select("select count(*) from sys")
    Integer getSystemCount();

    @Select("select count(*) from sys_table")
    Integer getTableCount();

    @Select("select name,count(st.*) as value from sys s, sys_table st where s.id = st.sys_id GROUP BY s.name")
    List<statisticsVO> getStatistics();

    @Select("select security_level as name ,count(*) as value from sys_table_field stf GROUP BY security_level")
    List<statisticsVO> getSecurityStatistics();

    @Select("select count(*) from sys_table_field")
    Integer getFieldCount();

}
